package com.delivery.deliverysystem.dao;

import com.delivery.deliverysystem.pojo.DO.Delivery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @author Administrator
* @description 针对表【delivery(送货单表)】的数据库操作Mapper
* @createDate 2025-01-13 15:37:40
* @Entity com.delivery.deliverysystem.pojo.DO.Delivery
*/
public interface DeliveryMapper extends BaseMapper<Delivery> {

    @Select("select coalesce(max(cast(right(delivery_id,3) as unsigned)),0) as maxNum from delivery where delivery_id like CONCAT('%', #{time}, '%')")
    int maxDeliveryIdNum(String time);

    @Update("UPDATE delivery SET status = 1 WHERE delivery_id = #{deliveryId}")
    int updateStatusToPrinted(String deliveryId);
}




